home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Invisible Universe
/
Invisible Universe (1995)(Voyager)[Mac-PC].iso
/
mac
/
UNIVERSE
/
SHARED.DIR
/
01005_Script_all purpose utility stuff
< prev
next >
Wrap
Text File
|
1995-11-21
|
5KB
|
163 lines
on setEditText
repeat with i = 2000 to 3002
if the castType of cast i = #Text then
--set the editableText of
end if
end repeat
end
on tweaker
repeat with i = 1 to 256
go frame i
setTopLeft 5,0,0
settopleft 6,0,27
setTopLeft 7,0,452
setTopLeft 8,4,58
end repeat
end tweaker
on setTopLeft theSprite, theH,theV
put the castNum of sprite theSprite into cN
if cN = 0 then exit
put the rect of cast cN into oldRect
--puppetSprite theSprite,true
spriteBox theSprite, (the left of oldRect)+theH, (the top of oldRect)+theV,(the right of oldRect)+theH, (the bottom of oldRect)+theV
updateStage
--puppetSprite theSprite,false
end setTopLeft
on getmovieNames theFirstCharMustBe
set movieList to []
repeat with i = 1 to 1023
set bob to getNthFileNameInFolder(the pathname,i)
if char 1 of bob <> theFirstCharMustBe then next repeat
if bob = "Shared.Dir" then next repeat
if char(length(bob)-3) to length(bob) of bob <> ".DIR" then next repeat
if char 1 of bob = "_" then next repeat
if bob = "" then exit repeat
add movieList,bob
end repeat
return movieList
end
on usedChannels
global it
set the updateMovieEnabled to true
put it into theMovies
set usedChannels to ""
repeat with i = 1 to count(theMovies)
go frame 1 of movie string(getAt(theMovies,i))
repeat with j = 1 to 500
go frame j
repeat with k = 1 to 48
if the castNum of sprite k <> 0 then
put integer(item k of usedChannels) into temp
put temp+1 into temp
put string(temp) into item k of usedChannels
end if
end repeat
end repeat
end repeat
put usedChannels
set mylist to list(usedChannels)
repeat with j = 1 to count(usedChannels)
put string(j)&": "&string(getat(mylist,j))
end repeat
end usedChannels
on createObjectList
global myMovieList,objectList,myLabelList, thisLabelName
put getMovieNames("O") into myMovieList
put "" into thisLabelName
set myLabelList to [:]
repeat with i = 1 to count(myMovieList)
put getAt(myMovieList,i) into thisMovie
go movie thisMovie
put linesToList(the labelList) into thisMoviesLabels
repeat with j = 1 to count(thisMoviesLabels)
put getAt(thisMoviesLabels,j) into thisLabelName
go frame label(thisLabelName)+1
put the castNum of sprite 8 into textCast
if textCast = 0 then next repeat
put the castNum of sprite 1 into pictCast
if pictCast <> 0 then
put the name of cast pictCast into pictCast
put the name of cast textCast into textCast
if prefix(pictCast) = thisLabelName then
do "addProp myLabelList, #"&(thisLabelName)&", list(textCast,the movieName)"
end if
end if
end repeat
end repeat
put myLabelList into field "O.DIR"
end createObjectList
on prefix what
return char 1 to offset(".",what)-1 of what
end prefix
on linesToList fromWhat
set newList to []
repeat with i = 1 to (the number of lines in fromWhat)
put word 1 of line i of fromWhat into it
if it <> "" then append newList,it
end repeat
return newList
end linesToList
on paletteTally
global movieList, paletteCount
set movieList to getmovieNames()
set paletteCount to [:]
repeat with i = 1 to count(movieList)
set paletteCounter to 0
put getAt(movieList,i) into it
go movie it
repeat with j = 1 to (the number of castmembers)
if the castType of cast j = #palette then
set paletteCounter to (paletteCounter+1)
end if
end repeat
addProp paletteCount,it,paletteCounter
end repeat
printPaletteTallyResults
end paletteTally
on printPaletteTallyResults
global paletteCount
put empty into it
repeat with i = 1 to count(paletteCount)
set it to it&return& getPropAt(paletteCount,i)&tab&getaProp(paletteCount, getPropAt(paletteCount,i))
end repeat
put it
end printPaletteTallyResults
on likeObjects
global hitList
set hitList to [:]
set oList to [:]
set it to ""
set lastLabel to ""
set oList to value(field "O.DIR")
--sort oList
repeat with i = 1 to count(oList)
put ","&(getPropAt(oList,i)) after it
-- if likeness(it,lastLabel) < 4 then
-- put it into lastLabel
-- next repeat
-- else
-- setaProp hitList, it, getaprop(hitList,it)+1
-- end if
end repeat
put it
end likeObjects
on likeness string1,string2
put 0 into likeness
repeat with i = 1 to max(length(string1),length(string2))
put likeness+integer((char i of string1)=(char i of string2)) into likeness
end repeat
return likeness
end likeness